import $axios from 'utils/Request.js'

//全部数据
export const get${table.javaName?cap_first}List = data => {
    return $axios({
        url: '/api/${table.name}/list',
        method: 'get',
        data
    });
}

//获取详情或者列表
export const get${table.javaName?cap_first} = data => {

    const id = data.id;

    let url = '/api/${table.name}/get';
    if(id != null && id != undefined) {
        url = url + "/" + id;
    }

    return $axios({
        url: url,
        method: 'get',
        data
    });
}

//保存
export const save${table.javaName?cap_first} = data => {
    return $axios({
        url: '/api/${table.name}/save',
        method: 'post',
        data
    });
}

//删除数据
export const delete${table.javaName?cap_first} = data => {
    return $axios({
        url: '/api/${table.name}/delete',
        method: 'delete',
        data
    });
}

//修改数据
export const update${table.javaName?cap_first}ById = data => {
    return $axios({
        url: '/api/${table.name}/update/' + data.id,
        method: 'put',
        data
    });
}